package com.bw.controller;

import com.bw.entity.vo.Admvo;
import com.bw.entity.vo.InterVo;
import com.bw.service.AdmService;
import com.bw.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: shujuzhongxin
 * @description:
 * @author: Mr.Wang
 * @create: 2020-06-03 14:20
 **/
@RestController
@CrossOrigin
@SuppressWarnings("all")
public class ConfigController {
    @Autowired
    private ConfigService configService;
    //用户管理列表
    @RequestMapping("ConfigList")
    public List<InterVo> ConfigList(@RequestParam("mohu")String mohu){
        return configService.ConfigList(mohu);
    }
    //批量删除
    @RequestMapping("batchesdel")
    public void batchesdel(@RequestParam("ids") String ids){
        String[] id = ids.split(",");
        for (String aa:id){
            this.configService.batchesdel(aa);
        }

    }
    @RequestMapping("startbatches")//批量启动
    public void startbatches(@RequestParam("ids") String ids){
        String[] id = ids.split(",");
        for (String aa:id){
            this.configService.startbatches(aa);
        }

    }
    @RequestMapping("forbiddenbatches")//批量禁用
    public void forbiddenbatches(@RequestParam("ids") String ids){
        String[] id = ids.split(",");
        for (String aa:id){
            this.configService.forbiddenbatches(aa);
        }

    }
    //添加接口配置
    @RequestMapping("addportconfiguration")
    public InterVo addportconfiguration(@RequestBody InterVo interVo){
        return this.configService.addportconfiguration(interVo);
    }

}
